<template>
    <div class="mask" :class="{hidden: hidden}">
        <div class="loader-box">
            <div class="loader">{{loadingText}}</div>
        </div>
    </div>
</template>
<script>
    export default {
        name: 'Loading',
        data() {
            return {
                loadingText: '',
                hidden: true
            }
        },
        methods: {
            start(msg) {
                this.loadingText = msg ? msg : this.$t('loading...');
                this.hidden = false;
            },
            stop() {
                this.hidden = true;
            }
        }
    }
</script>